import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.data.annotation.Transient;

/**
 * @desc: TODO
 * @author: zhangjiaqi
 * @time: 2020/11/25 14:28
 */
public class Article implements ReSerializeModel{
    @Transient
    @JSONField(serialize = false, deserialize = false)
    RString p1 = new RString("打卡的框架阿里1");
    RString p2 = new RString("打卡的框架阿里2");
    RString p3 = new RString("打卡的框架阿里3");
    @Transient
    @JSONField(serialize = false, deserialize = false)
    RString p4 = new RString("打卡的框架阿里4");
    RString p5 = new RString("打卡的框架阿里5");

    RInteger p6 = new RInteger(1);
    RInteger p7 = new RInteger(2);
    @Transient
    @JSONField(serialize = false, deserialize = false)
    RInteger p8 = new RInteger(3);
    RInteger p9 = new RInteger(4);
    @Transient
    @JSONField(serialize = false, deserialize = false)
    RInteger p10 = new RInteger(5);

    RList<String> list1 = new RList<>();
    RMap<String> map1 = new RMap<>();

    public Article(){
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");
        list1.getList().add("asdasd");

        map1.getMap().put("1", "1");
        map1.getMap().put("2", "2");
        map1.getMap().put("3", "3");
        map1.getMap().put("4", "4");
        map1.getMap().put("5", "5");
        map1.getMap().put("6", "6");
        map1.getMap().put("7", "7");
        map1.getMap().put("8", "9");
        map1.getMap().put("9", "9");

    }

    public RString getP1() {
        return p1;
    }

    public void setP1(RString p1) {
        this.p1 = p1;
    }

    public RString getP2() {
        return p2;
    }

    public void setP2(RString p2) {
        this.p2 = p2;
    }

    public RString getP3() {
        return p3;
    }

    public void setP3(RString p3) {
        this.p3 = p3;
    }

    public RString getP4() {
        return p4;
    }

    public void setP4(RString p4) {
        this.p4 = p4;
    }

    public RString getP5() {
        return p5;
    }

    public void setP5(RString p5) {
        this.p5 = p5;
    }

    public RInteger getP6() {
        return p6;
    }

    public void setP6(RInteger p6) {
        this.p6 = p6;
    }

    public RInteger getP7() {
        return p7;
    }

    public void setP7(RInteger p7) {
        this.p7 = p7;
    }

    public RInteger getP8() {
        return p8;
    }

    public void setP8(RInteger p8) {
        this.p8 = p8;
    }

    public RInteger getP9() {
        return p9;
    }

    public void setP9(RInteger p9) {
        this.p9 = p9;
    }

    public RInteger getP10() {
        return p10;
    }

    public void setP10(RInteger p10) {
        this.p10 = p10;
    }

    public RList<String> getList1() {
        return list1;
    }

    public void setList1(RList<String> list1) {
        this.list1 = list1;
    }

    public RMap<String> getMap1() {
        return map1;
    }

    public void setMap1(RMap<String> map1) {
        this.map1 = map1;
    }

    @Override
    public Object reSerialize() {
        return this;
    }

    @Override
    public Object toJson() {
        JSONObject json = new JSONObject();
        json.put("p2",SerializaUtils.toJSON(p2));
        json.put("p3", SerializaUtils.toJSON(p3));
        json.put("p5", SerializaUtils.toJSON(p5));
        json.put("p6", SerializaUtils.toJSON(p6));
        json.put("p7",SerializaUtils.toJSON(p7));
        json.put("p9",SerializaUtils.toJSON(p9));
        json.put("list1", SerializaUtils.toJSON(list1));
        json.put("map1",SerializaUtils.toJSON(map1));
        return json;
    }
}
